﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="visualizarPostNew.aspx.cs" Inherits="UI.visualizarPostNew" MasterPageFile="~/wiki.Master"%>

<asp:Content ID="editarPostNewContent" ContentPlaceHolderID="ContentPlaceHolder" runat="server">
    
        <asp:ScriptManager ID="ScriptManager" runat="server">
        </asp:ScriptManager>
            <asp:UpdatePanel ID="upComent" runat="server">
        <ContentTemplate>
        <asp:Panel ID="pnSucesso" runat="server" BackColor="#CCFFCC" 
        style="text-align: center" Visible="False">
        <img alt="" src="Images/Ok-16x16.png" style="width: 16px; height: 16px" />
        <asp:Label ID="lbMsgSucesso" runat="server" 
            style="font-weight: 700; color: #006600; font-size: small"></asp:Label>
    </asp:Panel>
    <asp:Panel ID="pnFalha" runat="server" BackColor="#FFCCCC" 
                    style="text-align: center" Visible="False">
                    &nbsp;<img alt="" src="Images/Error-16x16.png" 
                        style="width: 16px; height: 16px" />
                    <asp:Label ID="lbMsgFalha" runat="server" 
                        style="font-weight: 700; color: #FF0000; font-size: small;"></asp:Label>
                </asp:Panel>
        <h2><asp:Label ID="lbTitulo" runat="server"></asp:Label>
        </h2>
  
            <asp:Panel ID="pnContentPostNew" runat="server">
                &nbsp;</div><img id=imgPostNew runat="server" height="150" width="150"/> <asp:Label ID="lbContentPostNew" runat="server"></asp:Label>
                <br />
                <br />
                Tags da Post:<br />
                <asp:ListBox ID="lbTags" runat="server" Font-Italic="True" Font-Names="Verdana" 
                    Font-Size="X-Small" ForeColor="#666666" Height="50px" Width="195px">
                </asp:ListBox>
            </asp:Panel>
            <br />
            <asp:ImageButton ID="ibtFavoritar" runat="server" 
                ImageUrl="~/Images/favoritos.png" onclick="ibtFavoritar_Click" 
                Width="30px" ToolTip="Favoritar essa PostNew!" />
                <asp:ImageButton ID="ibtSeguir" runat="server" 
                ImageUrl="~/Images/add-user.png" onclick="ibtSeguir_Click" 
                Width="30px" ToolTip="Seguir esse Usuário!" />
            <br />
            <asp:UpdateProgress ID="UpdateProgress" runat="server" 
                AssociatedUpdatePanelID="UpdatePanelComment" DisplayAfter="10">
                <ProgressTemplate>
                    <img alt="" src="Images/carregando.gif" style="width: 16px; height: 16px" /><span 
                        style="font-size: 7.5pt"> Aguarde...</span>
                </ProgressTemplate>
            </asp:UpdateProgress>
            <br />
            <asp:UpdatePanel ID="UpdatePanelComment" runat="server">
                <ContentTemplate>
                    <asp:GridView ID="gvComment" runat="server" AllowPaging="True" 
                        AutoGenerateColumns="False" 
                        EmptyDataText="Essa Post New ainda não foi comentada. Seja o Primeiro!" 
                        onpageindexchanging="gvComment_PageIndexChanging" PageSize="5" Width="403px">
                        <Columns>
                            <asp:TemplateField HeaderText="Comentários">
                                <ItemTemplate>
                                    <table style="width: 100%; font-size: 11pt">
                                        <tr style="font-size: x-small">
                                            <td style="font-size: 10pt">
                                                <span style="font-size: x-small"><b>
                                                <asp:Label ID="lbNome" runat="server" style="font-style: italic" 
                                                    Text='<%# Eval("Usuario.nome") %>'></asp:Label>
                                                &nbsp;-
                                                <asp:Label ID="lbData" runat="server" style="font-style: italic" 
                                                    Text='<%# Eval("data") %>'></asp:Label>
                                                </b></span>
                                            </td>
                                        </tr>
                                        <span style="font-size: x-small">
                                        <tr>
                                            <td style="font-size: 10pt">
                                                <span style="font-size: 11pt"><span style="font-size: x-small">
                                                <span style="font-size: 11pt"><font size="2"><span style="font-size: x-small">
                                                <asp:Label ID="lbComentario" runat="server" Text='<%# Eval("descricao") %>'></asp:Label>
                                                </span></font></span></span></span>
                                            </td>
                                        </tr>
                                        </span>
                                    </table>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <br />
                    <asp:TextBox ID="txtComment" runat="server" Height="140px" TextMode="MultiLine" 
                        Width="410px"></asp:TextBox>
                    <br />
                    <asp:Button ID="btAddComment" runat="server" CssClass="botao" 
                        onclick="btAddComment_Click" Text="Adicionar comentário" Width="134px" />
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btAddComment" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
            <br />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btAddComment" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    </asp:Content>
